package com.zhouxiaoge.memcached;

import net.rubyeye.xmemcached.MemcachedClient;
import net.rubyeye.xmemcached.MemcachedClientBuilder;
import net.rubyeye.xmemcached.XMemcachedClientBuilder;
import net.rubyeye.xmemcached.utils.AddrUtil;

/**
 * @author 周明阳
 * email: gqzmy@outlook.com
 * Date: 2018-07-19 13:45
 */

public class Xmemcached {
    public static void main(String[] args) throws Exception {
        MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses("127.0.0.1:11211"));
        MemcachedClient client = builder.build();
        boolean set = client.set("XmemcachedKey", 0, "XmemcachedValue");
        System.out.println(set);
        Object xmemecachedKey = client.get("XmemcachedKey");
        System.out.println(xmemecachedKey);

    }
}
